Server Watch Plugin SDK | Date: 6 Feb 2004 Release: 1.0 |
#include <ISWServerData.h>
Server Watch will generate an instance of this class automatically. You will not need to store instances of this class as the appropriate instance will be passed into the plugin as a member of an SWPluginServerStruct when the plugin is expected to handle a server specific event.
Public Member Functions | |
Concurrency | |
Functions that manage the transaction based reader/writer thread safety process
Unlike the concurency functionality of ISWServerSettings, the concurrency of this class follows a very modified version of the readers/writers pattern (see ISWServerSettings for a good description of the classic pattern). It must be possible to read and write runtime data at the same time. To do otherwise can cause long delays in the user interface. To accomplish this we have created the following design:
| |
virtual void | BeginRead ()=0 |
Puts the class in read mode. | |
virtual void | EndRead ()=0 |
Removes the class from read mode. | |
virtual void | BeginWrite ()=0 |
Puts the class in write mode. | |
virtual void | EndWrite ()=0 |
Removes the class from write mode. | |
virtual void | Retain ()=0 |
Retains the class for use. | |
virtual void | Release ()=0 |
Removes your retain rights for the class. | |
Basic Runtime Server Values | |
virtual SWRESULT | SetServerName (std::wstring name)=0 |
Sets the name of the server as reported by the server. | |
virtual std::wstring | GetServerName () const =0 |
The name of the server as reported by the server. | |
virtual SWRESULT | SetMaxUsers (int users)=0 |
Sets the reported maximum number of users that can be on the server. | |
virtual int | GetMaxUsers () const =0 |
Retrieves the maximum number of user that can be on the server. | |
virtual SWRESULT | SetTotalUsers (int users)=0 |
Sets the reported current number of users that are on the server. | |
virtual int | GetTotalUsers () const =0 |
Retrieves the current number of users on the server. | |
virtual SWRESULT | SetAuxStat (std::wstring theStat)=0 |
Sets the text to be diaplyed in the AuxStat box. | |
virtual std::wstring | GetAuxStat () const =0 |
The text to be displayed in the AuxStat box. | |
virtual SWRESULT | SetStatusText (std::wstring theStatus)=0 |
Sets the text to be displayed as the "status" display in Server Watch. | |
virtual std::wstring | GetStatusText () const =0 |
Returns the text that will be displayed in the "status" display box. | |
Tray Icon | |
The plugin manages the values that will be displayed in the tray icon for monitored servers. The icon itself is set by calling SetIconNumber(), SetIconUp(), or SetIconDown(). A call to any one of these functions will override the previous setting. // pData is a pointer to an instance of ISWServerData pData->BeginWrite(); pData->SetIconNumber(10); pData->EndWrite(); // Icon now displays 10 pData->BeginWrite(); pData->SetIconUp(); pData->SetIconNumber(20); pData->EndWrite(); // Icon now displays 20 pData->BeginWrite(); pData->SetIconDown(); pData->EndWrite(); // Icon now displays down symbol | |
virtual SWRESULT | SetIconNumber (int num)=0 |
Sets the icon number to be desplayed by Server Watch. | |
virtual int | GetIconNumber () const =0 |
The number to be displayed in the tray icon. | |
virtual SWRESULT | SetIconUp ()=0 |
Sets the icon to display the "up" icon. | |
virtual SWRESULT | SetIconDown ()=0 |
Sets the icon to display the "down" icon. | |
virtual SWRESULT | SetIconTip (std::wstring theTip)=0 |
Sets the text to be displayed as the "tip" for the tray icon. | |
virtual std::wstring | GetIconTip () const =0 |
Returns the text to be displayed as the "tip" for the tray icon. | |
Data Tables | |
Each data table is displayed in Server Watch as an individual server pane. You can specify one of these tables to be the User Table. This table has special significance to the system. For example, its first column will be searched for user set "buddies" that may be on the server. If the buddy is found, a special column in the display of the Users Table will display that that individual is a buddy and alerts will be triggered. | |
virtual SWRESULT | CreateTable (const std::wstring &strTableID)=0 |
Creates a new table identified by the string strTableID. | |
virtual const bool | TableExists (const std::wstring &strTableID) const =0 |
Tests whether or not a specified table exists. | |
virtual const std::wstring & | GetTableName (const std::wstring &strTableID) const =0 |
Retrieves the name of a specified table. | |
virtual SWRESULT | SetTableName (const std::wstring &strTableID, const std::wstring &strName)=0 |
Sets the number of a specified table. | |
virtual SWRESULT | SetUsersTableID (const std::wstring &strName)=0 |
Sets ID that will be used as the users table. | |
virtual const std::wstring & | GetUsersTableID () const =0 |
Retrieves the ID that will be used as the users table. | |
virtual SWRESULT | SetNumCols (const std::wstring &strTableID, int NumCols)=0 |
Sets the number of columns on a specified table. | |
virtual int | GetNumCols (const std::wstring &strTableID) const =0 |
Retrieves the number of columns on a specified table. | |
virtual SWRESULT | SetColHeaderTitle (const std::wstring &strTableID, int index, const std::wstring &title)=0 |
Sets the name to be displayed for a table on a specified table. | |
virtual SWRESULT | GetColHeaderTitle (const std::wstring &strTableID, int index, std::wstring &title) const =0 |
Retrieves the name of a column on a specified table. | |
virtual SWRESULT | GetColDefaultWidth (const std::wstring &strTableID, int index, int &width) const =0 |
Retrieves the default width of a column on a specified table. | |
virtual SWRESULT | SetColDefaultWidth (const std::wstring &strTableID, int index, int width)=0 |
Sets the number of columns on a specified table. | |
virtual SWRESULT | SetColWidthToDefault (const std::wstring &strTableID)=0 |
Forces all columns on a table to have a current width that is the same as their default width. | |
virtual int | GetNumRows (const std::wstring &strTableID) const =0 |
Retrieves the number of rows on a specified table. | |
virtual int | GetNumRowsUncommitted (const std::wstring &strTableID) const =0 |
Retrieves the uncommited number of rows on a specified table. | |
virtual SWRESULT | ResetData (const std::wstring &strTableID)=0 |
Removes all the rows from a specified table. | |
virtual SWRESULT | AddRow (const std::wstring &strTableID)=0 |
Adds a new row to a specified table. | |
virtual SWRESULT | SetData (const std::wstring &strTableID, int col, int row, const std::wstring &data)=0 |
Sets the value of a specified table cell. | |
virtual SWRESULT | GetData (const std::wstring &strTableID, int col, int row, std::wstring &data) const =0 |
Retrieves the value of a specified table cell. | |
virtual SWRESULT | GetDataUncommitted (const std::wstring &strTableID, int col, int row, std::wstring &data) const =0 |
Retrieves the uncommited value of a specified table cell. | |
Custom Panes | |
virtual SWRESULT | InsertPane (ISWPluginPane *pane)=0 |
|
Puts the class in read mode. This function blocks if a call to EndWrite() is causing the write buffer to be copied into the read buffer. It will unblock when that copy is complete. |
|
Removes the class from read mode.
|
|
Puts the class in write mode.
You should update everything you intend to update before calling EndWrite(). Doing partial updates allows other threads to update the class and potential cause it to contain invalid data. |
|
Removes the class from write mode. This function will block until there are no readers and the write buffer has been completely copied into the read buffer. |
|
Retains the class for use.
Call Retain on the class when you spawn a thread. This will allow you to use the class without fear of it being deleted while you are using it. |
|
Removes your retain rights for the class. Only call Release if you have called Retain. Calling Release too many times will result in a crash in Server Watch. So, make sure your Release and Retain match up one-for-one. |
|
Sets the name of the server as reported by the server. This is not the same as the UserSetServerName() defined in ISWServerSettings. That name is chosen by the user of Server Watch.
|
|
The name of the server as reported by the server. This is not the same as the UserSetServerName() defined in ISWServerSettings. That name is chosen by the user of Server Watch.
|
|
Sets the reported maximum number of users that can be on the server.
|
|
Retrieves the maximum number of user that can be on the server.
|
|
Sets the reported current number of users that are on the server.
|
|
Retrieves the current number of users on the server.
|
|
Sets the text to be diaplyed in the AuxStat box.
|
|
The text to be displayed in the AuxStat box.
|
|
Sets the text to be displayed as the "status" display in Server Watch.
|
|
Returns the text that will be displayed in the "status" display box.
|
|
Sets the icon number to be desplayed by Server Watch. Only the values 0 - 9,999 are supported.
|
|
The number to be displayed in the tray icon.
|
|
Sets the icon to display the "up" icon.
|
|
Sets the icon to display the "down" icon.
|
|
Sets the text to be displayed as the "tip" for the tray icon.
|
|
Returns the text to be displayed as the "tip" for the tray icon.
|
|
Creates a new table identified by the string strTableID. The tables will be displayed in the order created.
|
|
Tests whether or not a specified table exists.
|
|
Retrieves the name of a specified table. The name of the table differes from the identifying string.
|
|
Sets the number of a specified table. The name of the table differes from the identifying string.
|
|
Sets ID that will be used as the users table. The primary difference between the users table and a regular table, is that the first column of the users table will be used for name searching during buddy identification. When displayed, the GUI will place an extra column indicator to display whether of not each row was identified as a buddy.
|
|
Retrieves the ID that will be used as the users table. The primary difference between the users table and a regular table, is that the first column of the users table will be used for name searching during buddy identification. When displayed, the GUI will place an extra column indicator to display whether of not each row was identified as a buddy.
|
|
Sets the number of columns on a specified table.
|
|
Retrieves the number of columns on a specified table.
|
|
Sets the name to be displayed for a table on a specified table.
|
|
Retrieves the name of a column on a specified table.
|
|
Retrieves the default width of a column on a specified table. The default width is the width that the column starts with before the user modifies it.
|
|
Sets the number of columns on a specified table. The default width is the width that the column starts with before the user modifies it.
|
|
Forces all columns on a table to have a current width that is the same as their default width. It is not common for a plugin to call this. The historical reason for its inclusion in the plugin API is for the extremely rare occasion when all the columns of a table are removed because some value has changed on the server (version number, for instance), and all new columns were added. At that time the old columns' widths would still be in place which would usually look bad to the user.
|
|
Retrieves the number of rows on a specified table. This function returns the commited value. If you need the value for the uncommited state, use the Uncommited version of this function.
|
|
Retrieves the uncommited number of rows on a specified table. This function returns the uncommited value. If you need the value for the commited state, use the standard version of this function.
|
|
Removes all the rows from a specified table. All row data will be reset, however, the columns will remain intact.
|
|
Adds a new row to a specified table. The row is added to the end of the table.
|
|
Sets the value of a specified table cell. A table cell is the intersection of a row and column in a table. Any string value is considered legal.
|
|
Retrieves the value of a specified table cell.
A table cell is the intersection of a row and column in a table.
|
|
Retrieves the uncommited value of a specified table cell.
A table cell is the intersection of a row and column in a table.
|
|
Inserts a class that implements ISWPluginPane into the list of panes related to the server.
|
Copyright (c) 2003-2004, Deep Fried Software. All rights reserved. |